package org.mysummerframework.web.context;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class ContextLoaderListener implements ServletContextListener{

	private static final Log logger = LogFactory.getLog(ContextLoaderListener.class);
	
	private ContextLoader contextLoader;
	
	public void contextInitialized(ServletContextEvent sce){
		logger.info("summer initialized .........");
		this.contextLoader = new ContextLoader();
		this.contextLoader.initWebApplicationContext(sce.getServletContext());

	}

	public void contextDestroyed(ServletContextEvent sce){
		//System.out.println("summer destroyed .........");
		logger.info("summer destroyed .........");
	}
}
